<%--
公司等待竞单的列表
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%pageContext.setAttribute("APP_PATH", request.getContextPath());%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>维修方</title>
    <meta name="description" content="Static &amp; Dynamic Tables" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <script src="${APP_PATH }/recourse/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="${APP_PATH }/recourse/css/font.css">
    <link rel="stylesheet" href="${APP_PATH}/recourse/css/login.css">
    <link rel="stylesheet" href="${APP_PATH }/recourse/css/xadmin.css">
    <script src="${APP_PATH }/assets/js/jquery-2.1.4.min.js"></script>
    <script src="${APP_PATH }/recourse/js/jquery-form.js"></script>
    <script type="text/javascript" src="${APP_PATH }/assets/js/xadmin.js"></script>
</head>

<body >
<form id = "feedback" name = "feedback" action="" method="post" enctype="multipart/form-data">
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin-left: 35px;">
    <ul class="layui-tab-title">
        <li class="layui-this">维修单详情</li>
        <li id="bg_one">反馈信息提交</li>
        <li id="bg_two">问题图片/视频</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <table width="650" height="300"  border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td><b>维修单名称：</b>${orders.order_name}</td>
                    <td><b>维修单编号：</b>${orders.id}</td>
                </tr>
                <tr>
                    <td><b>维修单目前状态：</b>${orders.state_name}</td>
                    <td><b>报修人员：</b>${orders.equipment_admin_name}</td>
                </tr>
                <tr>
                    <td><b>维修单所属部门：</b>${orders.department_id==1?"营房":(order.department_id==2?"装备":"公共")}</td>
                    <td><b>维修单拟定价格：</b>${orders.second_price}元</td>
                </tr>
                <tr>
                    <td><b>维修单发起时间：</b><fmt:formatDate value="${order.createTime}" type="date"/></td>
                </tr>
            </table>
            <p style="color: red;">设备管理员维修要求：</p><br>
            <div  class="module line-clamp" style="background-color: #F5F5F5 ;height: 80px;width: 700px">
                ${a.equals("")?(f.equals("")?"无":f):a}
            </div>
            <p style="color: red;margin-top: 10px;">审核员维修要求：</p><br>
            <div  class="module line-clamp" style="background-color: #F5F5F5 ;height: 80px;width: 700px">
                ${b.equals("")?"无":b}
            </div>
            <table width="650" height="50"  border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <b>维修问题表述：</b><br>
                    </td>
                </tr>
            </table>
            <div  class="module line-clamp" style="background-color: #F5F5F5 ;height: 80px;width: 700px">
                ${orders.problem_word}
            </div>
            <hr/>
        </div>

        <div class="layui-tab-item">
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>最终价格
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="final_price" name="final_price" placeholder="请注意价格的输入格式"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>维修最终价格为必填项(单位为元)
                </div>
            </div>
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>保修天数
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="time" name="time" placeholder="请注意天数的输入格式(整数)"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>保修天数为必填项(单位为天)
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>反馈描述</label>
                <div class="layui-input-inline" style="width: 320px">
                    <textarea id="states" name="states" placeholder="请输入反馈描述\无法维修的理由" class="layui-textarea" required="" lay-verify="required"></textarea>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>反馈描述在维修人员无法维修时是必填项
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>图片上传</label>
                <div class="layui-input-inline" style="width: 320px">
                    <input type="file"  name="photos" id="photos"  class="selectedLogoImgId"
                           accept="image/jpg,image/jpeg,image/png,image/bmp" style="margin-top: 8px;" multiple/>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>维修图片非为必填项
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>视频上传</label>
                <div class="layui-input-inline" style="width: 320px">
                    <input type="file"  name="videos" id="videos"  class="selectedLogoImgId"
                           accept="audio/mp4, video/mp4" style="margin-top: 8px;" multiple/>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>维修视频非为必填项
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>清单文件</label>
                <div class="layui-input-inline" style="width: 320px">
                    <input type="file"  name="listfile" id="listfile"  class="selectedLogoImgId"
                           style="margin-top: 8px;" multiple/>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>清单文件非为必填项
                </div>
            </div>
            <input id="id" type="hidden" name="id" value="${orders.id}"/>
            <input  id="suby" type="submit" class="layui-btn layui-btn-radius" style="margin-left: 150px;margin-top: 35px;" value="提交反馈"/>
            <button id="subn" class="layui-btn layui-btn-radius layui-btn-danger" type="submit" style="margin-left: 40px;margin-top: 35px;" onclick="xx()">无法维修</button>
        </div>

        <div class="layui-tab-item">
            <br>
            <p>图片信息</p>
            <div style="width:100%;margin:0 auto;">
                <c:forEach items="${photoes}" var="p_list" varStatus="status">
                    <div class="img">
                        <img border="12dp" src="/mmmsimage/${p_list}" alt="暂无图片信息" style="width:25%">
                    </div>
                </c:forEach>
            </div>
            <br>
            <p>视频信息</p>
            <c:forEach items="${video}" var="list_v" varStatus="status">
                <video width="320" height="240" style="margin-left: 200px;" controls autoplay>
                    <source src="/mmmsimage/${list_v}" type="video/mp4">
                    <object data="/mmmsimage/${list_v}" width="380" height="260">
                        <embed width="320" height="240" src="/mmmsimage/${list_v}">
                    </object>
                </video><br>
            </c:forEach>
        </div>
    </div>
</div>
</form>
<script type="text/javascript">
        $(document).ready(function () {
            $('#suby').click(function () {
                var mf = document.getElementById("feedback");
                mf.action="${pageContext.request.contextPath}/company/uppicture";
                var photos = document.getElementById("photos").value;
                var videos = document.getElementById("videos").value;
                var time = document.getElementById("time").value;
                var fial_time = document.getElementById("final_price").value;
                if(time!==""&&fial_time!==""&&(photos!==""||videos!=="")) {
                    $('#feedback').ajaxForm(function (data) {
                        if (data === 0) {
                            alert("提交成功!");
                            setTimeout(function () {
                                // 这里就是处理的事件
                                window.close();
                                window.opener.location.reload();
                            }, 700);
                        } else {
                            alert("提交失败!")
                        }
                    });
                }else{
                    alert("请检查价格，时间是否输入完整，视频或时间至少有一项不为空");
                }
            });
        });

        function xx () {
            var mf = document.getElementById("feedback");
            mf.action="${pageContext.request.contextPath}/company/norepaired";
            var reason = document.getElementById("states").value;
            if (reason !== "") {
                $('#feedback').ajaxForm(function (data) {
                    if (data === 0) {
                        alert("提交成功!");
                        setTimeout(function () {
                            // 这里就是处理的事件
                            window.close();
                            window.opener.location.reload();
                        }, 400);
                    } else {
                        alert("提交失败!");
                    }
                });
            }else{
                alert("无法维修的原因为必填项");
            }
        }
</script>
<style type="text/css">
    .imgdiv{
        float:left;
        width:300px;
        height:300px;
        margin:0 10px;
    }
    .imgdiv img{
        width:300px;
        height:220px;
    }
</style>
</body>
</html>




